﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace AliboboStockLib
{
    public class SQLFactory
    {
        public enum SQLType : int
        {
            sqlServer = 0,
            sqlite = 1
        }
        protected static SQLType platform = SQLType.sqlite;

        public static void setPlatform(SQLType v)
        {
            platform = v;
        }
        public static ISQLAgent getInstance(int p)
        {
            switch (p)
            {
                case 0:
                    return SQLServerAgent.getInstance();
                case 1:
                    return SQLiteAgent.getInstance();                     
            }
            return null;
        }


        public static ISQLAgent getInstance()
        {
            switch (platform)
            {
                case SQLType.sqlite:
                    return SQLiteAgent.getInstance();                     
                case SQLType.sqlServer:
                    return SQLServerAgent.getInstance();
            }
            return null;         
        }
    }
}
